//
//  BOSSSoundWaveController.h
//  Pay
//
//  Created by steve on 15-1-6.
//  Copyright (c) 2015年 steve. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SinVoicePlayer.h"
#import "SinVoiceRecognizer.h"
#import "ASIHTTPRequestDelegate.h"
#import "HookWebViewController.h"
@interface BOSSSoundWaveController : UIViewController<ASIHTTPRequestDelegate>{
@private
    SinVoicePlayer*     mSinVoicePlayer;
    SinVoiceRecognizer* mSinVoiceRecorder;
    
@public
    int mRates[100];
    int mPlayCount;
    int mResults[100];
    int mResultCount;
}
@property (strong,nonatomic) UIWebView *HTMLView;
@property (assign, atomic) BOOL isStop;
@property (nonatomic, assign) HookWebViewController *hookWebViewController;
-(void)onPlayData:(BOSSSoundWaveController*)data;
-(void)onRecogToken:(BOSSSoundWaveController*)data;
- (void)startPlay:(NSString *)sender;

/*************Voice Above**********/
@property (assign, nonatomic) BOOL isBalanceWarning;
@property (assign, nonatomic) BOOL isBalanceNotEnough;
@property (assign, nonatomic) BOOL isDeliver;
@property (assign, nonatomic) BOOL isBoss;
@property (assign, nonatomic) BOOL isPlaying;
@property (assign, nonatomic) BOOL isSend;
@property (assign, nonatomic) BOOL isRequesting;
@property (strong, nonatomic) NSTimer *waveTimer;
@property (strong, nonatomic) NSTimer *endPlayTimer;
@property (strong, nonatomic) NSTimer *endGameTimer;
@property (strong, nonatomic) NSTimer *indicatorTimer;
@property (strong, nonatomic) NSTimer *staffRequestTimer;
@property (assign, nonatomic) NSInteger waveCount;
@property (assign, nonatomic) NSInteger numOflaisee;
@property (assign, nonatomic) NSInteger soundPlayDuration;
@property (assign, nonatomic) NSInteger bossRequestTimeOutDuration;
@property (copy, nonatomic) NSString *waveStr;

@property (weak, nonatomic) IBOutlet UIImageView *show;
@property (weak, nonatomic) IBOutlet UIImageView *show2;
@property (weak, nonatomic) IBOutlet UIView *actionView;
@property (weak, nonatomic) IBOutlet UIView *background_view;
@property (weak, nonatomic) IBOutlet UIButton *startButton;
@property (weak, nonatomic) IBOutlet UIButton *sendingButton;
@property (weak, nonatomic) IBOutlet UIImageView *staff_wave_imageView;
@property (weak, nonatomic) IBOutlet UIView *assist_view;
@property (weak, nonatomic) IBOutlet UIImageView *round_imageView;

/*Tips view*/
@property (weak, nonatomic) IBOutlet UILabel *actionGuide_label;
@property (weak, nonatomic) IBOutlet UILabel *actionGuide2_label;
@property (weak, nonatomic) IBOutlet UILabel *warning_label;
@property (weak, nonatomic) IBOutlet UIImageView *warning_imageView;

/*发送laisee成功后，反馈展示feedback_view*/
@property (weak, nonatomic) IBOutlet UIView *feedback_view;
@property (weak, nonatomic) IBOutlet UILabel *feedback_label;
@property (weak, nonatomic) IBOutlet UIImageView *feedback_warning_imageView;
@property (weak, nonatomic) IBOutlet UILabel *feedback_warning_label;

/*发送laisee需要确认是否发送cofirm_view*/
@property (weak, nonatomic) IBOutlet UIView *confirm_view;
@property (weak, nonatomic) IBOutlet UILabel *confirm_userId_label;
@property (weak, nonatomic) IBOutlet UIButton *confirm_cancel_btn;
@property (weak, nonatomic) IBOutlet UIButton *confirm_send_btn;
- (IBAction)confirmCancelAction:(id)sender;
- (IBAction)confirmSendAction:(id)sender;
/*Boss点击send按钮sending_view*/
@property (weak, nonatomic) IBOutlet UIView *sending_view;
@property (weak, nonatomic) IBOutlet UILabel *sending_userId_label;
@property (weak, nonatomic) IBOutlet UIImageView *sending_indicator_imageView;

/*收到laisee后，反馈展示view*/
@property (weak, nonatomic) IBOutlet UIView *receive_cong_view;
@property (weak, nonatomic) IBOutlet UIView *receive_oops_view;
@property (weak, nonatomic) IBOutlet UILabel *oops_note_label;


@property (weak, nonatomic) IBOutlet UIButton *settingButton;
@property (weak, nonatomic) IBOutlet UIView *buttons_view;
@property (weak, nonatomic) IBOutlet UIView *collect_view;
@property (weak, nonatomic) IBOutlet UIView *collect_view1;
@property (weak, nonatomic) IBOutlet UIView *deliver_view;
@property (weak, nonatomic) IBOutlet UIView *deliver_view1;
@property (weak, nonatomic) IBOutlet UIButton *deliver_btn;
@property (weak, nonatomic) IBOutlet UIButton *collect_btn;
@property (weak, nonatomic) IBOutlet UILabel *collect_label;
@property (weak, nonatomic) IBOutlet UILabel *deliver_label;
- (IBAction)collectBtnClicked:(id)sender;
- (IBAction)deliverBtnClicked:(id)sender;

@end

